package com.bishe.supermarket.controller;

import com.bishe.supermarket.mapper.AdminMapper;
import com.bishe.supermarket.pojo.vo.Status;
import com.bishe.supermarket.service.PassWordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class PasswordController {

    @Autowired
    PassWordService passWordService;

    //密码页面跳转
    @RequestMapping("passWord")
    public String passWord(){


        return "updatePassword";
    }

    //接收密码

    @RequestMapping("receivePassword")
    public String receivePassword(String oldPassword, String newPassword, String reNewPassword, HttpSession httpSession){

     Status status = passWordService.updatePassword(oldPassword,newPassword,reNewPassword);

     httpSession.setAttribute("passwordMsg",status);


     return "updatePasswordMsg";
    }
}
